package com.open.capacity.finance.constant;

import com.fasterxml.jackson.annotation.JsonCreator;

public enum DealFlags {

    NO(0, ""),
    PROCESSING(1, "整改中"),
    COMPLETED(2, "整改完成");


    private int code;
    private String text;

    DealFlags(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return this.code;
    }

    public String getText() {
        return this.text;
    }

    @JsonCreator
    public static DealFlags valueOfEnum(int code) {

        DealFlags[] bss = values();

        for (DealFlags bs : bss) {
            if (bs.getCode() == code) {
                return bs;
            }
        }

        throw new IllegalArgumentException("code:" + code + "不存在!");
    }
}
